{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "936b0c17",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 调用模块\n",
    "import requests"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "b54c20f0",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'requests' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-3-70cd1d2a7814>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mr\u001b[0m \u001b[0;34m=\u001b[0m \u001b[0mrequests\u001b[0m\u001b[0;34m.\u001b[0m\u001b[0mget\u001b[0m\u001b[0;34m(\u001b[0m\u001b[0;34m\"https://cn.bing.com/search?q=api\"\u001b[0m\u001b[0;34m)\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m: name 'requests' is not defined"
     ]
    }
   ],
   "source": [
    "r = requests.get('https://cn.bing.com/search?q=api')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "d43dacdf",
   "metadata": {},
   "outputs": [
    {
     "ename": "NameError",
     "evalue": "name 'r' is not defined",
     "output_type": "error",
     "traceback": [
      "\u001b[0;31m---------------------------------------------------------------------------\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m                                 Traceback (most recent call last)",
      "\u001b[0;32m<ipython-input-4-5281e65f7dc7>\u001b[0m in \u001b[0;36m<module>\u001b[0;34m\u001b[0m\n\u001b[0;32m----> 1\u001b[0;31m \u001b[0mr\u001b[0m\u001b[0;34m\u001b[0m\u001b[0;34m\u001b[0m\u001b[0m\n\u001b[0m",
      "\u001b[0;31mNameError\u001b[0m: name 'r' is not defined"
     ]
    }
   ],
   "source": [
    "r "
   ]
  },
  {
   "cell_type": "markdown",
   "id": "192acab2",
   "metadata": {},
   "source": [
    "### 2种查看页面数据的方式\n",
    "* content\n",
    "1> 二进制的数据信息，可以观察数据格式\n",
    ">> 1，html：<!\n",
    ">>2,json"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "20c46274",
   "metadata": {},
   "outputs": [],
   "source": [
    "r.content"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "bdd7d95f",
   "metadata": {},
   "outputs": [],
   "source": [
    "r = requests."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "8dfd89de",
   "metadata": {},
   "outputs": [],
   "source": [
    "r"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "5d393925",
   "metadata": {},
   "outputs": [],
   "source": [
    "r.content"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "617427ac",
   "metadata": {},
   "outputs": [],
   "source": [
    "r.json()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0408aef7",
   "metadata": {},
   "outputs": [],
   "source": [
    "payload = ('name':'jinshan','job':'IT')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "60384aa8",
   "metadata": {},
   "outputs": [],
   "source": [
    "r = requ"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "1ae80d58",
   "metadata": {},
   "outputs": [],
   "source": [
    "# 2,face ++ detect实践"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4777f5b9",
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
